from selenium import webdriver
from selenium.webdriver.common.by import By
from ddt import ddt,file_data
from po.page4 import Page4
import unittest,time

@ddt()
class Case(unittest.TestCase):
    def setUp(self) -> None:
        print('begin case')
        self.driver=webdriver.Chrome()
        self.driver.maximize_window()
    def tearDown(self) -> None:
        print('end case')
        time.sleep(3)
        self.driver.quit()

    @file_data('login.json')
    def test_version_001(self,username,password):
        po=Page4(self.driver)
        po.open_url('http://localhost:8081/')
        po.login()
        time.sleep(2)
        po.username(username)
        time.sleep(1)
        po.password(password)
        time.sleep(1)
        po.loginbtn()

if __name__ == '__main__':
    unittest.main()